import 'package:flutter/material.dart';
import 'package:get/get.dart';

/// 块级按钮
class BlockButton extends StatelessWidget {
  final Color? color;
  final Function()? onTap;
  final String? title;

  const BlockButton({Key? key, this.color, this.onTap, this.title = ''})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        width: Get.width,
        alignment: Alignment.center,
        padding: EdgeInsets.symmetric(vertical: 12),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(12),
          color: color,
        ),
        child: Text(
          title!,
          style: TextStyle(fontSize: 17, color: Colors.white),
        ),
      ),
    );
  }
}
